package com.zyh.work2

object Number{
  def main(args: Array[String]): Unit = {
    val number = new Number()
    number.v1=2
    number.v2=3
    println(number)
    println(s"number.+ = ${number.+}")
    println(s"number.- = ${number.-}")
    println(s"number.* = ${number.*}")
    println(s"number./ = ${number./}")
  }
}
case class Number(){
  var v1:Int = _
  var v2:Int = _
  def this(v1:Int,v2:Int) = {
    this()
    this.v1=v1
    this.v2=v2
  }
  def + : Int = v1+v2
  def - : Int = v1-v2
  def * : Int = v1*v2
  def / : Int = v1/v2

  override def toString: String = v1+""+v2
}
